/**
 * @Description: test
 * @Author: Hu Outstanding
 * @Date: 2022/2/20 9:17
 */
package com.aaa.three.controller;

import com.aaa.three.aop.Log;
import com.aaa.three.pojo.query.AdminInfoOffice;
import com.aaa.three.result.AjaxResult;
import com.aaa.three.service.AdminQueryOfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("office")

public class AdminQueryOfficeController {


    @Autowired
    private AdminQueryOfficeService adminQueryOffice;

    @RequestMapping("queryDept")
    public AjaxResult queryDept(){
        return adminQueryOffice.queryDept();
    }

    @RequestMapping("queryState")
    public AjaxResult queryState(){
        return adminQueryOffice.queryState();
    }

    @RequestMapping("listOffice/{id}")
    public AjaxResult listOffice(@PathVariable("id") int id){
        return adminQueryOffice.listOffice(id);
    }

    @RequestMapping("queryOffice")
    public AjaxResult queryOffice(){
        return adminQueryOffice.queryOffice();
    }

    @RequestMapping("getOffice/{id}")
    public AjaxResult getOffice(@PathVariable("id") int id){
        return adminQueryOffice.getOffice(id);
    }

    @RequestMapping("deleteOffice/{id}")
    @Log("删除科室")
    public AjaxResult deleteOffice(@PathVariable("id") int id){
        return adminQueryOffice.deleteOffice(id);
    }

    @RequestMapping("updateOffice")
    @Log("修改科室")
    public AjaxResult updateOffice(AdminInfoOffice adminInfoOffice){
        return adminQueryOffice.updateOffice(adminInfoOffice);
    }

    @RequestMapping("addOffice")
    @Log("添加科室")
    public AjaxResult addOffice(AdminInfoOffice adminInfoOffice){
        return adminQueryOffice.addOffice(adminInfoOffice);
    }

}
